package com.ling.pl.autoproject.definition.logic.model;

import com.ling.pl.core.commons.annotation.Dict;
import com.ling.pl.core.commons.annotation.ModelProperty;

import javax.persistence.Column;

/**
 * 实体数据集
 */
public class Dataset {
    //实体数据集合信息
    @Column(name = "ENTITY_ID", length = 36)
    @ModelProperty(comment = "实体id")
    String entityId;

    @Column(name = "NAME", length = 150)
    @ModelProperty(comment = "中文名称")
    String name;

    @Column(name = "CODE", length = 150)
    @ModelProperty(comment = "查询标识")
    String code;

    @Column(name = "IS_DEFAULT")
    @ModelProperty(comment = "是否默认")
    Boolean isDefault;

    @Column(name = "DATASET_PRESET_TYPE", length = 150)
    @ModelProperty(comment = "预定义类型")
    @Dict(code = "builder.entity.datasetPresetType", des = "索引实体,多表单,代码表")
    String datasetPresetType;

    @Column(name = "DICT_CODE", length = 150)
    @ModelProperty(comment = "代码表时的代码表")
    String dictCode;

    @Column(name = "IS_GROUP")
    @ModelProperty(comment = "启用分组")
    Boolean isGroup;

    //关联查询
    @Column(name = "DATA_QUERY_ID", length = 36)
    @ModelProperty(comment = "关联查询")
    String dataQueryId;

    //默认排序及分页
    @Column(name = "SORT_PROPERTY1", length = 150)
    @ModelProperty(comment = "一级排序属性")
    String sortProperty1;

    @Column(name = "SORT_PROPERTY2", length = 150)
    @ModelProperty(comment = "二级排序属性")
    String sortProperty2;

    @Column(name = "SORT_PROPERTY_DIRECTION1", length = 150)
    @ModelProperty(comment = "一级排序属性方向")
    @Dict(code = "builder.entity.sortDirection", des = "升序,降序")
    String sortPropertyDirection1;

    @Column(name = "SORT_PROPERTY_DIRECTION2", length = 150)
    @ModelProperty(comment = "二级排序属性方向")
    @Dict(code = "builder.entity.sortDirection", des = "升序,降序")
    String sortPropertyDirection2;

    @Column(name = "PAGESIZE")
    @ModelProperty(comment = "默认分页大小")
    Integer pageSize;

    //数据范围
    @Column(name = "IS_ORG")
    @ModelProperty(comment = "启用机构范围权限")
    Boolean isOrg;

    @Column(name = "ORG_FILTER_TYPE", length = 150)
    @ModelProperty(comment = "机构数据范围(多选)")
    @Dict(code = "builder.org.orgFilterType", des = "当前机构,上级组织,下级组织")
    String orgFilterType;

    @Column(name = "IS_DEPT")
    @ModelProperty(comment = "启用机构范围权限")
    Boolean isDept;

    @Column(name = "DEPT_FILTER_TYPE", length = 150)
    @ModelProperty(comment = "部门数据范围(多选)")
    @Dict(code = "builder.org.deptFilterType", des = "当前部门,上级部门,下级部门")
    String deptFilterType;

    @Column(name = "IS_DEPT_BUSINESS")
    @ModelProperty(comment = "启用部门业务代码")
    Boolean isDeptBusiness;

    @Column(name = "DEPT_BUSINESS", length = 150)
    @ModelProperty(comment = "部门数据范围(多选)")
    String deptBusiness;

    @Column(name = "IS_USER")
    @ModelProperty(comment = "启用用户数据权限")
    Boolean isUser;

    @Column(name = "TODO", length = 500)
    @ModelProperty(comment = "todo")
    String todo;

    @Column(name = "REMARK", length = 500)
    @ModelProperty(comment = "备注")
    String remark;

}
